- content_for(:title, 'Registries')
- content_for(:body_id, 'registries_flow')

= render '/shared/breadcrumbs', breadcrumbs: ['Manage',
                                              link_to('Dashboard', dashboard_index_path),
                                              yield(:title)]

%section.registries
  = render 'shared/errors', errors: @registry.errors
  - if @registries
    %ul
      = render @registries

  %p
    = link_to 'Allow Insecure Registries:', 'https://github.com/CenturyLinkLabs/panamax-ui/wiki/How-to:-Add-Registries', title: 'Learn more about insecure registries.', target: '_blank'
    %strong= PanamaxUi.allow_insecure_registries

  = form_for @registry, html: { class: 'create-registry' } do |f|
    = f.text_field :name, placeholder: 'Give your registry a name'
    = f.text_field :endpoint_url, placeholder: 'http://localhost:5000'
    = f.submit 'Save Registry', class: 'button-positive'
    = link_to 'Cancel', '#', class: 'cancel', data: { toggle_class: 'expanded', toggle_target: 'section.registries', cancel_form: true }

  %a.button-add-positive{ data: { toggle: { class: 'expanded', target: 'section.registries' } } }
    Add a New Registry
